﻿using System;
using System.ComponentModel;
using System.Web.UI;

namespace UDS.Web.UI.Controls
{
    public class IntegerTextBox : RegexTextBox
    {
        private const string Pattern = @"^\s*\d+\s*$";

        [PersistenceMode(PersistenceMode.Attribute)]
        [DefaultValue(Pattern)]
        public override string Regex
        {
            get { return Pattern; }
            set { throw new InvalidOperationException(string.Format("The pattern '{0}' is not neccessary.", value)); }
        }
    }
}
